import type { App } from "vue";
/**
 * c-开通的组件全局引用
 * @param app 
 */
export default function globalComponents(app: App) {
  const components = import.meta.glob("./c-*/**.{vue,tsx,ts}", { eager: true }); //获取文件夹及其嵌套的多级子文件夹

  for (const [key, value] of Object.entries(components)) {
    console.log(key, value);
    const name = key.replace("./", "").split("/")[0];
    app.component(value.default.name || name, value.default);
  }
}